package main;

import java.util.ArrayList;

/**
  *  4g3nt
  *  Copyright (C) 2008  Carlos Molinero y César Andrés
  *
  *  This program is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  the Free Software Foundation, either version 3 of the License, or
  *  (at your option) any later version.
  *
  *  This program is distributed in the hope that it will be useful,
  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *  GNU General Public License for more details.
  *
  *    You should have received a copy of the GNU General Public License
  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
public class Errores {
	
	static ArrayList _errores = new ArrayList();
	
	public static void insertar(String error)
	{
		synchronized(_errores){
		_errores.add(error);}
		
	}
	static void escribir()
	{
		
		synchronized(_errores){
		   if (_errores.size()>0)
		   {
				  Global.escribir("<li class=\"closed\"><span class=\"folder\">Errores</span>");
				  Global.escribir("<ul>");
				  for (int i = 0 ; i < _errores.size();i++)
					Global.escribir("<li><span class=\"error\"> "+_errores.get(i)+"</span></li>");
				  Global.escribir("</ul>");
				  Global.escribir("</li>");
			   
		   }
		   else
		   {
				Global.escribir("<li><span class=\"file\"> No se encontraron errores</span></li>");
			   
		   }
		   _errores= new ArrayList();
		}
		
	}
}